<div class="row">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf">
            <div class="widget-head am-cf">
                <div class="widget-title am-cf">数据分析</div>
            </div>
            <div class="widget-body am-fr">
                <div class="page_toolbar am-margin-bottom-xs am-cf">
                    <form id="form-search" class="toolbar-form" action="">
                        <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">

                        <div class="am-u-sm-12 am-u-md-9" style="float: right">
                            <div class="am fr">

                                <div class="am-form-group am-fl">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form">
                                        <input type="text" class="am-form-field" name="search"
                                               placeholder="请输入合伙人名称" value="<?= $request->get('search') ?>">
                                        <div class="am-input-group-btn">
                                            <button class="am-btn am-btn-default am-icon-search"
                                                    type="submit"></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="am-u-sm-12">
                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                        <thead>
                        <tr>
                            <th>合伙人ID</th>
                            <th>合伙人名称</th>
                            <th>合伙人电话</th>
                            <th>合伙人分润</th>
                            <th>商家个数(直接推荐)</th>
                            <th>商家个数(员工推荐)</th>
                            <th>添加时间</th>

                        </tr>
                        </thead>
                        <tbody>

                        <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                            <tr>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['agent_id'] ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <?php if($item['company_name']):?>
                                        <p class="item-title"><?= $item['company_name'] ?></p>
                                    <?php else:?>
                                        <p class="item-title"><?= $item['real_name'] ?></p>
                                    <?php endif;?>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['company_tel'] ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['agentmoney'] ?></p>
                                </td>

                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['agentstore'] ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['clerk_num'] ?></p>
                                </td>

                                <td class="am-text-middle"><?= $item['create_time'] ?></td>


                            </tr>
                        <?php endforeach; else: ?>
                            <tr>
                                <td colspan="4" class="am-text-center">暂无记录</td>
                            </tr>
                        <?php endif; ?>
                        </tbody>
                    </table>
                </div>
                
                <div class="am-u-lg-12 am-cf">
                    <div class="am-fr"><?= $list->render() ?> </div>
                    <div class="am-fr pagination-total am-margin-right">
                        <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


